Skip to content

Add lazy utility to create lazy-loading UI components #2035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robertknight
Copy link
Member

Add a utility for creating components which are loaded only when rendered. When first rendered, a lazy component displays a fallback while the real implementation is fetched. It then renders the real component after the fetch completes. If the component fails to load an an error fallback is rendered in its place.

Part of hypothesis/h#9709.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (05d02f3) to head (e2a9243).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2035   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           70        71    +1     
  Lines         1330      1352   +22     
  Branches       498       503    +5     
=========================================
+ Hits          1330      1352   +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add a utility for creating components which are loaded only when rendered. When
first rendered, a lazy component displays a fallback while the real
implementation is fetched. It then renders the real component after the fetch
completes. If the component fails to load an an error fallback is rendered in
its place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant